package com.chixing.day09_innerclass.homework;

public class Password {
    public static void main(String[] args) {
        String word = "Welcome";
        char[] arr = word.toCharArray();
        char temp = arr[0];
        //加密
        for (int i = 0; i <arr.length-1 ; i++) {
            arr[i]=arr[i+1];

        }
        arr[arr.length-1]=temp;

        for (int j = 0; j < arr.length ; j++) {
            arr[j]= (char)(arr[j]+3);
        }
            System.out.println(arr);
        //解密
        for (int x = 0; x <arr.length ; x++) {
            arr[x] =(char)(arr[x]-3);
        }
        char temp1 = arr[arr.length-1];
        for (int k = arr.length-1; k>0; k--) {
            arr[k] = arr[k-1];
        }
        arr[0] = temp1;
        System.out.println(arr);
    }




}
